//
//  NextRegisteredVC.m
//  reSearchDemo
//
//  Created by 科技 on 15/7/29.
//  Copyright (c) 2015年 Kiwaro. All rights reserved.
//

#import "NextRegisteredVC.h"
#import "UIView+Layer.h"
@interface NextRegisteredVC ()<UITableViewDataSource,UITableViewDelegate>
{
    UITableView *_tableView;
    NSMutableArray *_dataSource;
}

@end

@implementation NextRegisteredVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    [self setRightBarButtonImage:LOADIMAGE(@"btn_more") highlightedImage:nil selector:@selector(menu)];
    
    UIView *actionbar = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.width, 44)];
    self.navigationItem.titleView = actionbar;
    UILabel *lab = [[UILabel alloc] initWithFrame:CGRectMake(8, 0, 100, 40)];
    lab.text = @"申请服务商";
    lab.font = [UIFont systemFontOfSize:20];
    lab.textColor = [UIColor whiteColor];
    [actionbar addSubview:lab];
    
    _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0,CGRectGetWidth(self.view.frame) , CGRectGetHeight(self.view.frame) )];
    _tableView.delegate = self;
    _tableView.dataSource = self;
    _tableView.tableFooterView = [[UIView alloc] init];
    
    [self.view addSubview:_tableView];
}

#pragma mark -
#pragma mark --按钮的响应事件--
-(void)menu {
    
}
#pragma mark --tableviewdelegate--
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 0;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *indentifier = @"cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:indentifier];
    if (!cell) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:indentifier];
    }
    
    return cell;
}
//设置tableview表头
-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
    UIView *headView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.view.frame), 200)];
    
    CGFloat Height = 40;
    UILabel *label1 = [[UILabel alloc] initWithFrame:CGRectMake(40, 40, 120, Height)];
    label1.text = @"上传身份证正面:";
    label1.font = [UIFont systemFontOfSize:14];
    UIButton *btn1 = [UIButton buttonWithType:UIButtonTypeCustom];
    btn1.frame = CGRectMake(CGRectGetMaxX(label1.frame) + 10, CGRectGetMinY(label1.frame) + 5, 30, 30);
    [btn1 setImage:[UIImage imageNamed:@"plus@2x-1"] forState:UIControlStateNormal];
    [UIView SetRoundedCorners:btn1 andcornerRadius:1.0 andborderWidth:1.0 andborderColor:[UIColor lightGrayColor]];
    [btn1 addTarget:self action:@selector(BtnAction:) forControlEvents:UIControlEventTouchUpInside];
    
    UILabel *label2 = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMinX(label1.frame), CGRectGetMaxY(label1.frame), 120, Height)];
    label2.text = @"上传身份证反面:";
    label2.font = [UIFont systemFontOfSize:14];
    UIButton *btn2 = [UIButton buttonWithType:UIButtonTypeCustom];
    btn2.frame = CGRectMake(CGRectGetMaxX(label2.frame) + 10, CGRectGetMinY(label2.frame) + 5, 30, 30);
    [btn2 setImage:[UIImage imageNamed:@"plus@2x-1"] forState:UIControlStateNormal];
    [UIView SetRoundedCorners:btn2 andcornerRadius:1.0 andborderWidth:1.0 andborderColor:[UIColor lightGrayColor]];
    [btn2 addTarget:self action:@selector(BtnAction:) forControlEvents:UIControlEventTouchUpInside];
    
    UILabel *label3 = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMinX(label1.frame), CGRectGetMaxY(label2.frame), 140, Height)];
    label3.text = @"上传手持身份证照片:";
    label3.font = [UIFont systemFontOfSize:14];
    UIButton *btn3 = [UIButton buttonWithType:UIButtonTypeCustom];
    btn3.frame = CGRectMake(CGRectGetMaxX(label3.frame) + 10, CGRectGetMinY(label3.frame) + 5, 30, 30);
    [btn3 setImage:[UIImage imageNamed:@"plus@2x-1"] forState:UIControlStateNormal];
    [UIView SetRoundedCorners:btn3 andcornerRadius:1.0 andborderWidth:1.0 andborderColor:[UIColor lightGrayColor]];
    [btn3 addTarget:self action:@selector(BtnAction:) forControlEvents:UIControlEventTouchUpInside];
    
    UILabel *label4 = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMinX(label1.frame), CGRectGetMaxY(label3.frame), 160, Height)];
    label4.text = @"上传个人有效银行卡照片:";
    label4.font = [UIFont systemFontOfSize:14];
    UIButton *btn4 = [UIButton buttonWithType:UIButtonTypeCustom];
    btn4.frame = CGRectMake(CGRectGetMaxX(label4.frame) + 10, CGRectGetMinY(label4.frame) + 5, 30, 30);
    [btn4 setImage:[UIImage imageNamed:@"plus@2x-1"] forState:UIControlStateNormal];
    [UIView SetRoundedCorners:btn4 andcornerRadius:1.0 andborderWidth:1.0 andborderColor:[UIColor lightGrayColor]];
    [btn4 addTarget:self action:@selector(BtnAction:) forControlEvents:UIControlEventTouchUpInside];
    
    [headView addSubview:label1];
    [headView addSubview:label2];
    [headView addSubview:label3];
    [headView addSubview:label4];
    [headView addSubview:btn1];
    [headView addSubview:btn2];
    [headView addSubview:btn3];
    [headView addSubview:btn4];
    
    headView.frame = CGRectMake(0, 0, CGRectGetWidth(self.view.frame), CGRectGetMaxY(label4.frame) + 40);
    
    return headView;
}
//设置tableview表头的高
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
    UIView *headView = [self tableView:tableView viewForHeaderInSection:section];
    return CGRectGetHeight(headView.frame);
}

#pragma mark -
#pragma mark --点击按钮响应方法-
-(void)BtnAction:(UIButton *)sender {
    UIActionSheet *sheet = [[UIActionSheet alloc] initWithTitle:@"提示:" delegate:nil cancelButtonTitle:@"取消" destructiveButtonTitle:nil otherButtonTitles:@"拍照",@"相册", nil];
    [sheet showInView:self.view];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
